//
//  LTSouCangTableViewCell.m
//  UIA_ximalaya
//
//  Created by Lee on 15/12/15.
//  Copyright © 2015年 lite. All rights reserved.
//

#import "LTSouCangTableViewCell.h"

@implementation LTSouCangTableViewCell
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {

        [self createview];
    }
    return self;
}
- (void)createview {
    self.backgroundColor = [UIColor colorWithRed:1 green:0.95 blue:0.78 alpha:1];
    self.label = [[UILabel alloc] initWithFrame:CGRectZero];
    self.label.font = [UIFont boldSystemFontOfSize:16];
    self.imageview = [[UIImageView alloc] initWithFrame:CGRectZero];
    [self addSubview:self.label];
    [self addSubview:self.imageview];

}
- (void)setStorageModel:(Storage *)storageModel {
    if (_storageModel != storageModel) {
        _storageModel = storageModel;
    }
    self.label.text = _storageModel.title;
    [self.imageview sd_setImageWithURL:[NSURL URLWithString:storageModel.photo] placeholderImage:[UIImage imageNamed:@"160.jpg"]];
}


-(void)layoutSubviews{
    [super layoutSubviews];
  
    self.imageview.frame = CGRectMake(10*XWIDTH, 10*XHIGHT, 30*XWIDTH, 30*XHIGHT);
      self.label.frame = CGRectMake(self.imageview.right+10*XWIDTH, 0, WIDTH-50, 50*XHIGHT);
}


- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
